% section 6.4.1 'robustness' / Income Profiles 
% this file shows the differences in CE for GHHW and GLTHI 
% using PSID income

clear;
addpath functions
load('./results/allstates_main.mat');
load('./results/model_parameters_main.mat');
load('./results/capHtmod_c.mat');
iX = simulation_output.iX;
model_parameters.capHtmod= capHtmod_c;
model_parameters.income_file ='../../data/processed/IncomeProcess/trends_psid.csv';
model_parameters.outputfile ='./results/allstates_main_psid.mat';
model_output_psid = solve_main(model_parameters,iX);
writetable(model_output_psid.maintable,'./results/table_main_psid.xlsx');

% cut analysis at 65 y/o

%model_parameters.income_file ='../../data/processed/IncomeProcess/trends_psid.csv';
model_parameters.outputfile ='./results/allstates_main_psid_cut65.mat';
iX  = iX(1:40,:);
model_parameters.MU = model_parameters.MU(:,:,1:40);
model_parameters.CAPH = model_parameters.CAPH(:,:,1:39);
model_output_psid_65 = solve_main(model_parameters,iX);
writetable(model_output_psid_65.maintable,'./results/table_main_psid_cut65.xlsx');

